package com.centaline.androidsalesblog.adapter;

import android.content.Context;
import android.view.View;

import com.centaline.androidsalesblog.R;
import com.centaline.androidsalesblog.adapter.viewholder.SysMsgVH;
import com.centaline.androidsalesblog.model.businissobject.SysMsgBo;
import com.centanet.framework.base.BaseAdapter1;

import java.util.ArrayList;

/**
 * 系统消息
 */
public class SysMsgAdapter extends BaseAdapter1<SysMsgVH> {

    private final ArrayList<SysMsgBo> list;

    public SysMsgAdapter(Context context, ArrayList<SysMsgBo> list) {
        super(context);
        this.list = list;
    }

    @Override
    protected int inflateByLayoutId() {
        return R.layout.item_sys_msg_list;
    }

    @Override
    protected SysMsgVH viewHolder(View view) {
        return new SysMsgVH(view);
    }

    @Override
    public void onBindViewHolder(SysMsgVH holder, int position) {
        final SysMsgBo sysMsgBo = list.get(position);
        holder.atv_title.setText(sysMsgBo.getTitle());
        holder.atv_content.setText(sysMsgBo.getRemark());
    }

    @Override
    public int getItemCount() {
        return list.size();
    }
}
